package com.sleep.psy.external_server.business.evaluation.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sleep.psy.external_server.business.evaluation.entity.EvaluationRecord;
import com.sleep.psy.external_server.business.evaluation.entity.sleep.SubGeneralScaleReq;
import com.sleep.psy.external_server.business.evaluation.entity.sleep.SubQuestionReq;
import com.sleep.psy.external_server.business.evaluation.entity.sleep.SubSleepReq;
import com.sleep.psy.external_server.business.evaluation.entity.sleep.SubSleepScaleReq;
import com.sleep.psy.external_server.result.Result;

import java.util.List;

/**
 * <p>
 * 测评记录 服务类
 * </p>
 *
 * @author wenliguo
 * @since 2025-08-12
 */
public interface EvaluationRecordService extends IService<EvaluationRecord> {

    /**
     * 提交匹兹堡测评记录
     * @author wenliguo
     * @date 2025/6/6 09:18
     * @param req 请求
     * @return com.sleep.psy.main_server.result.Result
     */
    Result subSleepScale(SubSleepScaleReq req);

    /**
     * 通用量表提交
     * @author wenliguo
     * @date 2025/7/23 10:12
     * @param req 请求参数
     * @return com.sleep.psy.main_server.result.Result
     */
    Result subGeneralScale(SubGeneralScaleReq req);

    /**
     * 提交isi测评记录
     * @author wenliguo
     * @date 2025/7/9 16:46
     * @param req 请求
     * @return com.sleep.psy.main_server.result.Result
     */
    Result subIsi(SubSleepScaleReq req);

    /**
     * 提交睡眠问卷记录
     * @author wenliguo
     * @date 2025/6/6 14:50
     * @param req 请求
     * @return com.sleep.psy.main_server.result.Result
     */
    Result subSleepQuestion(SubQuestionReq req);

    /**
     * 通过用户id和量表id获取测评记录
     * @author wenliguo
     * @date 2025/6/17 14:48
     * @param userId 用户id
     * @param scaleId 量表id
     * @return java.util.List<com.sleep.psy.main_server.business2.evaluation.entity.EvaluationRecord>
     */
    List<EvaluationRecord> selectRecordsByUserIdScaleId(Long userId, Integer scaleId);

    /**
     * 通过测评记录id和用户id获取有效测评记录
     * @author wenliguo
     * @date 2025/6/9 11:29
     * @param id 测评记录id
     * @param userId 用户id
     * @return com.sleep.psy.main_server.business2.evaluation.entity.EvaluationRecord
     */
    EvaluationRecord selectRecord(Long id,Long userId);

    /**
     * 通过用户id判断用户是否答过失眠问卷和睡眠问卷
     * @author wenliguo
     * @date 2025/8/27 17:19
     * @param userId 用户id
     * @return com.sleep.psy.external_server.result.Result
    */
    Result isAnswerQuestion(Long userId);


    /**
     * 通过用户id获取失眠问卷记录
     * @author wenliguo
     * @date 2025/8/27 17:32
     * @param userId 用户id
     * @return com.sleep.psy.external_server.result.Result
    */
    Result selectSleeplessRecordByUserId(Long userId);

    /**
     * 通过量表id和用户id判断用户是否答过该量表
     * @author wenliguo
     * @date 2025/8/28 09:45
     * @param scaleId 量表id
     * @param userId 用户id
     * @return com.sleep.psy.external_server.result.Result
    */
    Result isAnswer(Integer scaleId, Long userId);

    /**
     * 提交失眠问卷
     * @author wenliguo
     * @date 2025/8/28 15:29
     * @param req 请求
     * @return com.sleep.psy.external_server.result.Result
    */
    Result subSleepLessScale(SubGeneralScaleReq req);

    /**
     * 判断是否答过睡眠评估
     * @author wenliguo
     * @date 2025/9/8 11:04
     * @param req 请求参数
     * @return com.sleep.psy.external_server.result.Result
    */
    Result subSleep(SubSleepReq req);
}
